package com.lorenzogao.service

import com.lorenzogao.repository.GirlRepository
import com.lorenzogao.domian.Gril
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

/**
 * Created by 15270 on 2018/1/23.
 */

@Service
class GirlService {

    @Autowired
    private lateinit var girlRepository: GirlRepository

    @Transactional //事务
    fun insertTwo(){
        var girl= Gril("A", 18,30)
        girlRepository.save(girl)

        var girl2= Gril("B", 19,30)
        girlRepository.save(girl2)

    }
}